package com.flyxteam.commons.dao.mybatis.core.sqlbuilder;

import java.util.List;

import com.flyxteam.commons.dao.mybatis.api.condition.Condition;

/**
 * DELETE SQL构建器
 * @author yuzh
 *
 */
public class DeleteSqlBuilder extends ConditionSqlBuilder {

	public DeleteSqlBuilder(String tableName, List<Condition> conditionColumns) {
		this.tableName = tableName;
		this.conditionColumns = conditionColumns;
	}
	
	@Override
	public String buildSqlString() {
		// delete from tableName where ... 
		StringBuilder deleteSql = new StringBuilder("delete from ");
		deleteSql.append(tableName).append(" ");
		String conditionSql = buildConditionSqlString();
		deleteSql.append(conditionSql);
		
		return deleteSql.toString();
	}

}
